package com.usian.feign;

import com.usian.model.admin.dtos.NewsAuthDto;
import com.usian.model.common.dtos.PageResponseResult;
import com.usian.model.common.dtos.ResponseResult;
import com.usian.model.media.pojos.WmNews;
import com.usian.model.media.pojos.WmUser;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@FeignClient(value = "leadnews-wemedia")
public interface WemediaFeign {

    @GetMapping("/api/v1/news/findByNewId/{id}")
    public WmNews findByNewId(@PathVariable("id") Integer id);

    @PostMapping("/api/v1/news/updateNews")
    public boolean updateNews(@RequestBody WmNews wmNews);

    @GetMapping("/api/v1/news/findByUserId/{id}")
    public WmUser findByUserId(@PathVariable("id") Integer id);

    @PostMapping("/api/v1/news/findWmnews")
    public List<Integer> findWmnews();

    @PostMapping("/api/v1/news/findList")
    public PageResponseResult findListRengong(@RequestBody NewsAuthDto dto);

    @GetMapping("/api/v1/news/findDetail/{id}")
    public WmNews findDetail(@PathVariable("id") Integer id);

    @PostMapping("/api/v1/news/auth")
    public ResponseResult auth(@RequestBody NewsAuthDto dto,@RequestParam int type);
}
